import styled from 'styled-components'

export const Box = styled.div`
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9999;
  user-select: none;
  &.hide {
    display: none;
  }
`

export const Wrapper = styled.div`
  width: 80px;
  height: 80px;
  padding: 10px 0;
  background-color: rgba(0, 0, 0, .6);
  border-radius: 5px;
  position: absolute;
  box-sizing: border-box;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  color: white;
  text-align: center;
`

export const Content = styled.div`
  width: 100%;
  text-align: center;
  .loader {
    box-sizing: border-box;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 25%;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
  }
  @-webkit-keyframes ball-spin-fade-loader {
    50% {
        opacity: 0.3;
        -webkit-transform: scale(0.4);
        transform: scale(0.4);
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
  }
  @keyframes ball-spin-fade-loader {
    50% {
        opacity: 0.3;
        -webkit-transform: scale(0.4);
        transform: scale(0.4);
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
  }
  .ball-spin-fade-loader {
    position: relative;
  }
  .ball-spin-fade-loader > div:nth-child(1) {
    top: 32px;
    left: -12px;
    -webkit-animation: ball-spin-fade-loader 1s 0s infinite linear;
    animation: ball-spin-fade-loader 1s 0s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(2) {
    top: 17.04545px;
    left: 17.04545px;
    -webkit-animation: ball-spin-fade-loader 1s 0.12s infinite linear;
    animation: ball-spin-fade-loader 1s 0.12s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(3) {
    top: -12px;
    left: 32px;
    -webkit-animation: ball-spin-fade-loader 1s 0.24s infinite linear;
    animation: ball-spin-fade-loader 1s 0.24s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(4) {
    top: -40.04545px;
    left: 17.04545px;
    -webkit-animation: ball-spin-fade-loader 1s 0.36s infinite linear;
    animation: ball-spin-fade-loader 1s 0.36s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(5) {
    top: -52px;
    left: -12px;
    -webkit-animation: ball-spin-fade-loader 1s 0.48s infinite linear;
    animation: ball-spin-fade-loader 1s 0.48s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(6) {
    top: -40.04545px;
    left: -40.04545px;
    -webkit-animation: ball-spin-fade-loader 1s 0.6s infinite linear;
    animation: ball-spin-fade-loader 1s 0.6s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(7) {
    top: -12px;
    left: -52px;
    -webkit-animation: ball-spin-fade-loader 1s 0.72s infinite linear;
    animation: ball-spin-fade-loader 1s 0.72s infinite linear;
  }
  .ball-spin-fade-loader > div:nth-child(8) {
    top: 17.04545px;
    left: -40.04545px;
    -webkit-animation: ball-spin-fade-loader 1s 0.84s infinite linear;
    animation: ball-spin-fade-loader 1s 0.84s infinite linear;
  }
  .ball-spin-fade-loader > div {
    background-color: #fff;
    width: 15px;
    height: 15px;
    border-radius: 100%;
    margin: 2px;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    position: absolute;
  }
`

export const Title = styled.div`
  width: 100%;
  position: absolute;
  bottom: 2px;
  text-align: center;
  padding: 5px;
  box-sizing: border-box;
`
